package resource

import (
	"project-info/src/handle/terminal"
	"project-info/src/router/req"
	"project-info/src/router/variable"

	"github.com/gin-gonic/gin"
)

func init() {
	variable.InitRouteFunc = append(variable.InitRouteFunc, InitTerminalRoute)
}

func InitTerminalRoute(e *gin.Engine) {
	terminalGroup := req.NewGroup("/terminal").NeedToken().SetUpGroup(e)
	reqs := []*req.Conf{
		req.NewGet("/ssh", terminal.SSHWebSocketHandler).WithMiddleware(req.DataPermissionHandlerConfig()),
	}
	req.BatchSetUpRouter(terminalGroup, reqs)
}
